//
//  ViewController.m
//  gq
//
//  Created by zhoucan on 2018/4/6.
//  Copyright © 2018年 com.gqcltz.ios. All rights reserved.
//

#import "ViewController.h"
#import <AVOSCloud/AVOSCloud.h>
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webview;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    AVQuery * obj = [AVQuery queryWithClassName:@"yq"];
    [obj findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
        
        if (objects != nil && objects.count > 0) {
            
            
            AVObject * yq = objects.lastObject;
            NSString * urlStr = yq[@"urlstr"];
            NSURL * url = [NSURL URLWithString:urlStr];
            NSURLRequest * re = [NSURLRequest requestWithURL:url];
            [self.webview loadRequest:re];
            
        }
        
        
        
    }];
    
    
    
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
